//
//  ZhuihaojiluACell.m
//  SSC
//
//  Created by 红沙尘 on 17/6/12.
//  Copyright © 2017年 红沙尘. All rights reserved.
//

#import "ZhuihaojiluACell.h"

@implementation ZhuihaojiluACell
{
    __weak IBOutlet UILabel *yueLabel;
    __weak IBOutlet UILabel *beishuLabel;
    __weak IBOutlet UILabel *haomaLabel;
    __weak IBOutlet UIView *lineView;
    
    __weak IBOutlet NSLayoutConstraint *lineA;
    __weak IBOutlet NSLayoutConstraint *lineB;
    __weak IBOutlet NSLayoutConstraint *lineC;
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    lineA.constant = LineHeight;
    lineB.constant = LineHeight;
    lineC.constant = LineHeight;
    
    lineView.layer.borderColor = COLOR_CCCCCC.CGColor;
    lineView.layer.borderWidth = LineHeight;
}

- (void)loadWithDict:(NSMutableDictionary *)dict {
    
    NSMutableArray *txtArray = @[].mutableCopy;
    
    NSArray *list = dict[@"list"];
    
    for (int i = 0; i < list.count; i ++) {
        
        NSDictionary *listDict = list[i];
        
        NSString *code = listDict[@"code"];
        NSString *playname = listDict[@"playname"];
        
        if ([playname isEqualToString:@"一星定位胆"]) {
            
            NSString *place = [NSString safeString:listDict[@"place"]];

            code = [MTool dingweidanCode:code place:place];
            
        } else if ([playname isEqualToString:@"龙虎和>万个"]) {
            code = [MTool longhuheCode:code];
        }
        [txtArray addObject:[NSString stringWithFormat:@"玩法: %@\n号码: %@",playname,code]];

        beishuLabel.text = [NSString stringWithFormat:@"倍数: %@",listDict[@"doubles"]];
        
    }
    
    yueLabel.text = [NSString stringWithFormat:@"金额: %@元",dict[@"amount"]];
    haomaLabel.text = [txtArray componentsJoinedByString:@"\n\n"];
}

@end
